# To change this template, choose Tools | Templates
# and open the template in the editor.

class MMap:

    def __init__(self, mlib, name="new mmap"):
        self.words = []
        self.mlib = mlib
        self.name = name

    def get_name(self):
        return self.name

    def update_name(self, name):
        self.name = name
        return self.name

    def update_words(self, word):
        self.words.append(word)
        return self.words

    def remove_word(self, word):
        if word in self.words:
            self.words.remove(word)
            self.mlib.remove_uniq_word(word)
        return self.words

    def get_words(self):
        return self.words

    def word_new_or_present(self, name=""):
        w = self.mlib.get_word(name)
        return w
